package com.xvyy.tingshu.estest.repository;

import com.xvyy.tingshu.estest.entity.Person;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * ClassName: Person
 * Package: com.xvyy.tingshu.estest.repository
 *
 * @Description:
 * @Author: xvyy
 * @Create: 2025/1/17 - 20:00
 * @Version: v1.0
 */
// repository 注解，表明这是一个持久层组件，spring会自动生成对应的代理对象
@Repository
public interface PersonRepository extends CrudRepository<Person, Long> {

    /**
     * 根据名字查询用户
     * @param name
     * @return
     */
    List<Person> findPersonByName(String name);

    /**
     * 根据名字和地址查询用户
     * @param name
     * @param address
     * @return
     */
    List<Person> findPersonByNameAndAddress(String name, String address);
}
